const http=require('http')
const _url=require('url')
const path=require('path')
const fs=require('fs')
//引入依赖项目
const mime = require('mime')
const server=http.createServer((req,res)=>{
    let parmas=''
    let _parmas=''
    let route=_url.parse(req.url)
    req.on('data',chunk=>{
        parmas+=chunk
        _parmas=new URLSearchParams(parmas)
    })
    req.on('end',()=>{
        console.log(_parmas.get('money'),mime.getType(route.pathname))
    })
    res.end('请求结束')
})
server.listen(8070,'127.0.0.1',()=>{
    console.log(`服务器运行在：http://127.0.0.1:8070`)
})